package com.example.person.repository;

import com.example.person.entity.Person;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @author sytsnb@gmail.com
 * @date 2023 2023/3/14 23:40
 */
@Repository
public interface PersonRepository extends JpaRepository<Person, String> {
    /**
     * 按照 jpa  hibernate 命名规范自定义方法
     * 按姓名包含或 ID 号或手机或电子邮件查找人按创建时间排序
     *
     * @param name
     * @param idNo
     * @param mobilePhone
     * @param email
     * @return
     */
    List<Person> findPersonByNameContainingOrIdNoOrMobilePhoneOrEmailOrderByCreateTime(String name, String idNo, String mobilePhone, String email);

}
